#include<stdio.h>
#include <iostream>
using namespace std;
class Date
{
private:
	int Year, Month, Day;
public:
	void ADD();
	void Settime(int year, int month, int day)
	{
		Year = year;
		Month = month;
		Day = day;
	}
	void Showtime()
	{
		cout << Day << '/' << Month << '/' << Year ;
	}
};
void Date::ADD()
{
	if (Month != 2)
	{
		if (Day > 29)
		{
			if ((Month / 2 == 1 && Month != 9) || Month == 10 || Month == 12)
			{
				if (Day == 30)
					Day++;
				else
				{
					Day = 1;
					Month++;

				}
			}
			else
			{
				Month++;
				Day = 1;
			}
		}
		else
			Day++;
	}
	else
	{
		if (Day == 28)
		{
			if (Year % 400 == 0 || (Year / 4 == 0 && Year / 100 != 0))
			{
				Day++;
			}
			else
			{
				Day = 1;
				Month++;
			}
		}
		else
			Day++;
		if (Day == 30)
		{
			Day = 1;
			Month++;
		}
	}
	if (Month == 13)
	{
		Year++;
		Month = 1;
	}
}
int main()
{
	int x, y, z;
	int x1, y2, z3;
	class Date d;
	cin >> x >> y >> z;
	cin >> x1 >> y2 >> z3;
	d.Settime(x, y, z);
	d.ADD();
	cout << "after add: ";
	d.Showtime();
	d.Settime(x1, y2, z3);
	cout << endl;
	cout << "new date: ";
	d.Showtime();
	return 0;

}
